/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

/* 导航样式 */
header {
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 2em;
}

nav {
    display: flex;
    justify-content: center;
    gap: 30px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    transition: all 0.3s;
    font-weight: 500;
}

nav a:hover {
    background-color: #34495e;
    transform: translateY(-2px);
}

/* 主要内容区域 */
main {
    max-width: 1200px;
    margin: 0 auto 30px;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* 推荐商品网格布局 */
.recommendations #recommend-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* 商品列表网格布局 */
.product-list #product-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* 商品卡片样式 */
.product-card, .product-item {
    border: 1px solid #e0e0e0;
    padding: 20px;
    border-radius: 8px;
    transition: all 0.3s;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-card:hover, .product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* 商品图片URL显示样式 */
.product-image-url {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    min-height: 80px;
}

.product-image-url label {
    display: block;
    font-weight: bold;
    color: #555;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.product-image-url .image-url {
    color: #2980b9;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.4;
    background-color: white;
    padding: 8px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.product-card h3, .product-item h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.product-card .price, .product-item .price {
    color: #e74c3c;
    font-size: 1.3em;
    font-weight: bold;
    margin: 10px 0;
}

.product-card .description, .product-item .description {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
    line-height: 1.4;
}

/* 按钮样式 */
.btn-primary {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
    transform: translateY(-2px);
}

.btn-cancel {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9em;
    font-weight: 500;
    margin-left: 5px;
}

.btn-cancel:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
}

.btn-confirm {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9em;
    font-weight: 500;
    margin-left: 5px;
}

.btn-confirm:hover {
    background-color: #219a52;
    transform: translateY(-1px);
}

/* 搜索栏样式 */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.search-bar input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.search-bar button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background-color: white;
    color: #333;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination button:hover {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.pagination button.current {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* 商品详情页样式 */
.product-detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.product-image {
    display: flex;
    align-items: flex-start;
}

.product-detail-content .product-image-url {
    width: 100%;
    max-width: 400px;
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-height: 120px;
}

.product-detail-content .product-image-url label {
    font-size: 1em;
    color: #2c3e50;
    margin-bottom: 10px;
}

.product-detail-content .product-image-url .image-url {
    font-size: 0.9em;
    padding: 12px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.product-info h2 {
    color: #2c3e50;
    font-size: 2em;
    margin-bottom: 15px;
}

.product-info .price {
    color: #e74c3c;
    font-size: 2.5em;
    font-weight: bold;
    margin: 20px 0;
}

.product-description, .product-features {
    margin: 20px 0;
}

.product-description h4, .product-features h4 {
    color: #34495e;
    margin-bottom: 10px;
}

.product-features ul {
    list-style: none;
    padding: 0;
}

.product-features li {
    padding: 5px 0;
    color: #27ae60;
}

.product-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-selector input {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: center;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-content h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.order-item {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.total-price {
    font-size: 1.2em;
    font-weight: bold;
    color: #e74c3c;
}

/* 用户中心样式 */
.user-profile {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.user-profile h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.user-details p {
    margin: 10px 0;
    font-size: 1.1em;
}

.user-actions {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

/* 表单样式 */
.auth-forms {
    max-width: 400px;
    margin: 0 auto 30px;
    padding: 25px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.auth-forms h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
}

form div {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* 订单历史样式 */
.order-history {
    margin-top: 30px;
}

.order-history h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.order-item {
    border: 1px solid #e0e0e0;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    background-color: white;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.order-status-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-buttons {
    display: flex;
    gap: 5px;
}

.order-id {
    font-weight: bold;
    color: #2c3e50;
}

.order-status {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: bold;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

.order-details p {
    margin: 5px 0;
}

/* 错误和空状态样式 */
.error-message, .no-products, .no-orders {
    text-align: center;
    color: #7f8c8d;
    font-size: 1.1em;
    padding: 40px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-size: 0.9em;
    background-color: white;
    border-radius: 8px;
    margin-top: 30px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    nav {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .recommendations #recommend-list,
    .product-list #product-list-container {
        grid-template-columns: 1fr;
    }

    .product-detail-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .user-actions {
        flex-direction: column;
    }

    .search-bar {
        flex-direction: column;
    }

    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .order-status-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
    }

    .order-buttons {
        width: 100%;
        justify-content: flex-start;
    }

    .product-image-url .image-url {
        font-size: 0.8em;
        padding: 10px;
    }

    .product-detail-content .product-image-url {
        max-width: 100%;
        padding: 15px;
        min-height: 100px;
    }
}

@media (max-width: 480px) {
    main {
        padding: 15px;
    }

    .modal-content {
        padding: 20px;
    }

    .product-actions {
        gap: 10px;
    }

    .order-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .btn-confirm, .btn-cancel {
        margin-left: 0;
        width: 100%;
    }
}